home *** CD-ROM | disk | FTP | other *** search
/ PC Elektro 3 / PC-Elektro-3-cd1.bin / KBan 2.0 / KBANSRC.LZH / SRC / PROG / KBANVIEW.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-07  |  5.3 KB  |  154 lines

  1. // the declaration of CKBANView
  2. // Copyright (C) 1997 Kazutaka Hirata <khirata@jove.acs.unt.edu>
  3.  
  4. #ifndef _NEWVIEW_H_
  5. #define _NEWVIEW_H_
  6.  
  7. // stdafx.h should be included already.
  8.  
  9. #include "cmd/deffunc.h"
  10. #include "cmd/dlpin.h"
  11. #include "cmd/dlline.h"
  12. #include "cmd/dlcomp.h"
  13. #include "cmd/edblock.h"
  14. #include "cmd/edblockl.h"
  15. #include "cmd/edpaste.h"
  16. #include "cmd/edpin.h"
  17. #include "cmd/edpull.h"
  18. #include "cmd/eddivide.h"
  19. #include "cmd/edmvline.h"
  20. #include "cmd/plpin.h"
  21. #include "cmd/plline.h"
  22. #include "cmd/plcomp.h"
  23. #include "cmd/sugrid.h"
  24.  
  25. #include "grid.h"
  26. #include "kbandoc.h"
  27. #include "kbanfunc.h"
  28.  
  29. #define HIDDEN_STRING_LEN 100
  30.  
  31. class CKBANView : public CScrollView
  32. {
  33.   DECLARE_DYNCREATE(CKBANView)
  34. private:
  35.   KBAN_FUNCTION*    m_current_mmi;
  36.   DEFAULT_FUNC      m_default_func;
  37.   EDIT_BLOCK        m_edit_block;
  38.   EDIT_BLOCK_LAYER  m_edit_block_layer;
  39.   EDIT_PASTE        m_edit_paste;
  40.   EDIT_PULL         m_edit_pull;
  41.   EDIT_DIVIDE       m_edit_divide;
  42.   EDIT_MOVE_LINE    m_edit_move_line;
  43.   EDIT_PIN          m_edit_pin;
  44.   SETUP_GRID_ORIGIN m_setup_grid_origin;
  45.   PLACE_PIN         m_place_pin;
  46.   PLACE_LINE        m_place_line;
  47.   PLACE_COMPONENT   m_place_component;
  48.   DELETE_PIN        m_delete_pin;
  49.   DELETE_LINE       m_delete_line;
  50.   DELETE_COMPONENT  m_delete_component;
  51.   uint              m_moved;
  52.   XY                m_dc_old;
  53.   XY                m_pc_old;
  54.   UINT              m_nGridID;
  55.   UINT              m_nLayerID;
  56.   bool              m_bDisableRedraw;
  57.   char              m_hidden_string[HIDDEN_STRING_LEN + 1];
  58.   typedef (KBAN_FUNCTION::*MOUSE_FUNC)(KBAN_INFO& info, KBAN_DRAW& draw, const XY& pc, UINT nFlags);
  59.  
  60.   PIN_ELEMENT*       m_ctxt_target_pin;
  61.   LINE_ELEMENT*      m_ctxt_target_line;
  62.   COMPONENT_ELEMENT* m_ctxt_target_comp;
  63. public:
  64.   CKBANView();
  65.   CKBANDoc* GetDocument() { return (CKBANDoc*)m_pDocument; }
  66. protected:
  67.   void          ChangeCommandCore(KBAN_INFO& info, KBAN_DRAW& draw, KBAN_FUNCTION* func);
  68.   void          ChangeCommand(KBAN_FUNCTION* func);
  69.   virtual void  OnDraw(CDC*);
  70.   virtual void  OnInitialUpdate();
  71.   virtual void  OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
  72.   afx_msg BOOL  OnEraseBkgnd(CDC* pDC);
  73.   void          OnMouseGeneral(UINT nFlags, CPoint point, MOUSE_FUNC func);
  74.   afx_msg void  OnMouseMove  (UINT nFlags, CPoint point);
  75.   afx_msg void  OnLButtonUp  (UINT nFlags, CPoint point);
  76.   afx_msg void  OnLButtonDown(UINT nFlags, CPoint point);
  77.   afx_msg void  OnRButtonUp  (UINT nFlags, CPoint point);
  78.   afx_msg void  OnRButtonDown(UINT nFlags, CPoint point);
  79.   afx_msg void  OnSize(UINT nType, int cx, int cy);
  80.   enum SCROLL_DIRECTION {
  81.     SCROLL_UP   ,
  82.     SCROLL_DOWN ,
  83.   SCROLL_LEFT ,
  84.     SCROLL_RIGHT
  85.   };
  86.   void          OnScrollCore(SCROLL_DIRECTION sd);
  87.   afx_msg void  OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  88.   afx_msg void  OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
  89.   afx_msg void  OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
  90.   afx_msg void  OnMove(int x, int y);
  91.   afx_msg void  OnVScroll(UINT nCode, UINT nPos, CScrollBar* pScrollBar);
  92.   afx_msg void  OnHScroll(UINT nCode, UINT nPos, CScrollBar* pScrollBar);
  93.  
  94.   // edit
  95.   afx_msg void  OnUndo();
  96.   afx_msg void  OnUpdateUndo(CCmdUI* pCmdUI);
  97.   afx_msg void  OnRedo();
  98.   afx_msg void  OnUpdateRedo(CCmdUI* pCmdUI);
  99.   afx_msg void  OnEditCutCopyDelete(UINT nID);
  100.   afx_msg void  OnUpdateCutCopyDelete(CCmdUI* pCmdUI);
  101.   afx_msg void  OnEditUnselectAll();
  102.   afx_msg void  OnUpdateUnselectAll(CCmdUI* pCmdUI);
  103.   afx_msg void  OnUpdatePaste(CCmdUI* pCmdUI);
  104.  
  105.   // view
  106.   afx_msg void  OnZoomCore(UINT nID);
  107.   afx_msg void  OnRedraw();
  108.   afx_msg void  OnChangeSnap();
  109.   afx_msg void  OnUpdateSnap(CCmdUI* pCmdUI);
  110.   afx_msg void  OnChangePinOnCommon();
  111.   afx_msg void  OnUpdatePinOnCommon(CCmdUI* pCmdUI);
  112.   afx_msg void  OnChangeFill();
  113.   afx_msg void  OnUpdateFill(CCmdUI* pCmdUI);
  114.   afx_msg void  OnChangeHole();
  115.   afx_msg void  OnUpdateHole(CCmdUI* pCmdUI);
  116.   afx_msg void  OnHelpDebug();
  117.   afx_msg void  OnToolsPurge();
  118.   afx_msg void  OnChangeGrid(UINT nID);
  119.   afx_msg void  OnUpdateGrid(CCmdUI* pCmdUI);
  120.   afx_msg void  OnSetGridWidth();
  121.   afx_msg void  OnResetGrid();
  122.   afx_msg void  OnAptPin();
  123.   afx_msg void  OnAptLine();
  124.  
  125.   // context
  126.   afx_msg void  OnContextEditPin();
  127.   afx_msg void  OnContextSelectPin();
  128.   afx_msg void  OnContextUnselectPin();
  129.   afx_msg void  OnContextSelectLine();
  130.   afx_msg void  OnContextUnselectLine();
  131.   afx_msg void  OnContextSelectComponent();
  132.   afx_msg void  OnContextUnselectComponent();
  133. public:
  134.   afx_msg void  OnChangeLayer(UINT nID);
  135. protected:
  136.   afx_msg void  OnUpdateLayer(CCmdUI* pCmdUI);
  137.   afx_msg void  OnChangeShowLayer(UINT nID);
  138.   afx_msg void  OnUpdateShowLayer(CCmdUI* pCmdUI);
  139.   afx_msg void  OnChangeCommand(UINT nID);
  140.   afx_msg void  OnIsEmpty();
  141.   afx_msg void  OnUserMessage(UINT wParam, LONG lParam);
  142.  
  143.   // status bar
  144.   afx_msg void  OnUpdateIndicatorX(CCmdUI* pCmdUI);
  145.   afx_msg void  OnUpdateIndicatorY(CCmdUI* pCmdUI);
  146.   afx_msg void  OnUpdateIndicatorLayer(CCmdUI* pCmdUI);
  147.   afx_msg void  OnUpdateIndicatorZoom(CCmdUI* pCmdUI);
  148.   afx_msg void  OnUpdateIndicatorGrid(CCmdUI* pCmdUI);
  149.   afx_msg void  OnUpdateIndicatorCommand(CCmdUI* pCmdUI);
  150.   DECLARE_MESSAGE_MAP()
  151. };
  152.  
  153. #endif /* _NEWVIEW_H_ */
  154.